<div class="row">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-title">
                <h5>
                    <vc:i18n name="添加" namespace="addInstrument"></vc:i18n>
                </h5>
                <div class="ibox-tools" style="top:10px;">
                    <button type="button" class="btn btn-white " v-on:click="vc.goBack()">
                        <i class="fa fa-close"></i>
                        <vc:i18n name="返回"></vc:i18n>
                    </button>
                </div>
            </div>
            <div class="ibox-content">
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='仪表编码' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-4">
                        <input v-model="addInstrumentInfo.machineCode" type="text" :placeholder="vc.i18n('必填，请填写仪表编码','addInstrument')" class="form-control">
                    </div>
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='仪表名称' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-4">
                        <input v-model="addInstrumentInfo.machineName" type="text" :placeholder="vc.i18n('必填，请填写仪表名称','addInstrument')" class="form-control">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='上报时间' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-3">
                        <input v-model="addInstrumentInfo.upMin" type="number" :placeholder="vc.i18n('必填，请填写上报时间','addInstrument')" class="form-control">
                    </div>
                    <label class="col-sm-1 col-form-label text-left">
                        <vc:i18n name='min' namespace='addInstrument'></vc:i18n>
                    </label>
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='采样时间' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-3">
                        <input v-model="addInstrumentInfo.checkSec" type="number" :placeholder="vc.i18n('必填，请填写采样时间','addInstrument')" class="form-control">
                    </div>
                    <label class="col-sm-1 col-form-label text-left">
                        <vc:i18n name='sec' namespace='addInstrument'></vc:i18n>
                    </label>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='仪表厂家' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-4">
                        <select class="custom-select" v-model="addInstrumentInfo.implBean" @change="_changeFactory()">
                            <option selected disabled value="">{{vc.i18n('必填，请选择仪表厂家','addInstrument')}}</option>
                            <option :value="item.factoryId" v-for="(item, index) in factoryList">{{item.factoryName}}</option>
                        </select>
                    </div>
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='仪表类型' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-4">
                        <select class="custom-select" v-model="addInstrumentInfo.typeId">
                            <option selected disabled value="">{{vc.i18n('必填，请选择仪表类型','addInstrument')}}</option>
                            <option :value="item.typeId" v-for="(item, index) in instrumentTypeList">{{item.name}}</option>
                        </select>
                    </div>
                </div>
                <div class="form-group row" v-for="(item,index) in addInstrumentInfo.specs">
                    <label class="col-sm-2 col-form-label  text-right">{{item.specName}}</label>
                    <div class="col-sm-4">
                        <input v-model.trim="item.value" type="text" :placeholder="item.remark" class="form-control">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-right">
                        <vc:i18n name='传感器' namespace='addInstrument'></vc:i18n>
                    </label>
                    <div class="col-sm-4">
                        <button class="btn btn-primary" type="button" v-on:click="_addInstrumentSensor()">
                            添加
                        </button>
                    </div>
                </div>
                <div class="form-group row" v-for="(item,index) in addInstrumentInfo.sensorList">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-2">
                        <select class="custom-select" v-model="item.sensorType">
                            <option disabled selected value="">{{vc.i18n('传感器类型','addInstrument')}}</option>
                            <option v-for="(sensorType, i) in sensorTypeList" :value="sensorType.statusCd">{{sensorType.name}}</option>
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <select class="custom-select" v-model="item.paramType" @change="_changeParamType(item.id)">
                            <option value="1001">{{vc.i18n('数值型','addInstrument')}}</option>
                            <option value="1002">{{vc.i18n('非数值型','addInstrument')}}</option>
                        </select>
                    </div>
                    <div class="col-sm-2" v-if="item.paramType == '1001'">
                        <input v-model="item.minValue" type="text" :placeholder="vc.i18n('最小值（保留2位小数）','addInstrument')" class="form-control">
                    </div>
                    <div class="col-sm-2" v-if="item.paramType == '1001'">
                        <input v-model="item.maxValue" type="text" :placeholder="vc.i18n('最大值（保留2位小数）','addInstrument')" class="form-control">
                    </div>
                    <div class="col-sm-1" v-if="item.paramType == '1001'">
                        <input v-model="item.units" type="text" :placeholder="vc.i18n('单位','addInstrument')" class="form-control">
                    </div>
                    <div class="col-sm-1">
                        <button class="btn btn-danger" v-on:click="_removeInstrumentSensor(item)">
                            <vc:i18n name='删除'></vc:i18n>
                        </button>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12 text-right">
                    <button type="button" class="btn btn-warning " style="margin-right:20px;" @click="vc.goBack()">
                        <vc:i18n name="返回"></vc:i18n>
                    </button>
                    <button class="btn btn-primary" type="button" v-on:click="saveInstrumentInfo()">
                        <i class="fa fa-check"></i>&nbsp;提交
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>